package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc EvaObjTargetCycleWeightDto
 * @使用场景
 */
@Data
public class EvaObjTargetCycleWeightDto
        extends BaseDto
        implements Serializable {

    /**
     * 对象目标周期权重设置ID
     */
    @ApiModelProperty("对象目标周期权重设置ID")
    private String objTargetCycleWeightSetId;

    /**
     * 被评对象目标周期ID
     */
    @ApiModelProperty("被评对象目标周期ID")
    private String evaObjTargetCycleId;

    /**
     * 权重分值
     */
    @ApiModelProperty("权重分值")
    private Double weightScore;

    /**
     * 权重
     */
    @ApiModelProperty("权重")
    private Double weightValue;

    /**
     * 是否父周期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否父周期不能为空")
    @ApiModelProperty("是否父周期")
    private String isParentCycle;

    /**
     * 是否子周期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否子周期不能为空")
    @ApiModelProperty("是否子周期")
    private String isSubCycle;

    /**
     * 是否中期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否中期不能为空")
    @ApiModelProperty("是否中期")
    private String isMetaphase;

    /**
     * 冗余评价模板ID
     */
    @NotNull(message = "冗余评价模板ID不能为空")
    @ApiModelProperty("冗余评价模板ID")
    private String evaluationTemplateId;

    /**
     * 批次ID
     */
    @NotNull(message = "批次ID不能为空")
    @ApiModelProperty("批次ID")
    private String batchCode;

    /**
     * 目标周期简称
     */
    @ApiModelProperty("目标周期简称")
    private String cyclelAlias;

    /**
     * 周期名称
     */
    @ApiModelProperty("周期名称")
    private String cycleStandardName;

    /**
     * 周期类型实例简称
     */
    @ApiModelProperty("周期类型实例简称")
    private String cycleNumberShortName;

    /**
     * 周期开始时间
     */
    @ApiModelProperty("周期开始时间")
    private Date cycleStartTime;

    /**
     * 周期结束时间
     */
    @ApiModelProperty("周期结束时间")
    private Date cycleEndTime;

    /**
     * 虚拟组织下部门ID
     */
    @ApiModelProperty("虚拟组织下部门ID")
    private String deptId;

    /**
     * 虚拟组织成员就职记录ID
     */
    @ApiModelProperty("虚拟组织成员就职记录ID")
    private String virtualOrgInductionRecordId;

    /**
     * 主体生命周期 CURRENTLY_VALID:当前有效 EDITING:正在编辑 ARCHIVING:历史存档
     */
    @ApiModelProperty("主体生命周期")
    private String subjectLifeCycle;

    /**
     * 关联目标内容ID
     */
    @ApiModelProperty("关联目标内容ID")
    private String targetCycleContentId;

    /**
     * 父子中周期类型 PARENT_CYCLE:父周期 SUB_CYCLE:子周期 MID_CYCLE:中期
     */
    @ApiModelProperty("父子中周期类型")
    private String parentSubMidCycleType;

    /**
     * 周期ID
     */
    @ApiModelProperty("周期ID")
    private String cycleId;

    /**
     * 相对上级排序
     */
    @NotNull(message = "相对上级排序不能为空")
    @ApiModelProperty("相对上级排序")
    private Long relativeOrderNumber;

    /**
     * 目标周期名称
     */
    @ApiModelProperty("目标周期名称")
    private String targetCycleName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        EvaObjTargetCycleWeightDto that = (EvaObjTargetCycleWeightDto) o;
        return (
                objTargetCycleWeightSetId == that.objTargetCycleWeightSetId &&
                        evaObjTargetCycleId == that.evaObjTargetCycleId &&
                        weightScore == that.weightScore &&
                        weightValue == that.weightValue &&
                        isParentCycle == that.isParentCycle &&
                        isSubCycle == that.isSubCycle &&
                        isMetaphase == that.isMetaphase &&
                        evaluationTemplateId == that.evaluationTemplateId &&
                        batchCode == that.batchCode &&
                        cyclelAlias == that.cyclelAlias &&
                        cycleStandardName == that.cycleStandardName &&
                        cycleNumberShortName == that.cycleNumberShortName &&
                        cycleStartTime == that.cycleStartTime &&
                        cycleEndTime == that.cycleEndTime &&
                        deptId == that.deptId &&
                        virtualOrgInductionRecordId == that.virtualOrgInductionRecordId &&
                        subjectLifeCycle == that.subjectLifeCycle &&
                        targetCycleContentId == that.targetCycleContentId &&
                        parentSubMidCycleType == that.parentSubMidCycleType &&
                        cycleId == that.cycleId &&
                        relativeOrderNumber == that.relativeOrderNumber &&
                        targetCycleName == that.targetCycleName
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                objTargetCycleWeightSetId,
                evaObjTargetCycleId,
                weightScore,
                weightValue,
                isParentCycle,
                isSubCycle,
                isMetaphase,
                evaluationTemplateId,
                batchCode,
                cyclelAlias,
                cycleStandardName,
                cycleNumberShortName,
                cycleStartTime,
                cycleEndTime,
                deptId,
                virtualOrgInductionRecordId,
                subjectLifeCycle,
                targetCycleContentId,
                parentSubMidCycleType,
                cycleId,
                relativeOrderNumber,
                targetCycleName
        );
    }

}
